package cn.com.huzo.repository.master.impl;

import cn.com.huzo.model.entities.master.StockReasonEntity;
import huzofw.repository.impl.GenericRepositoryImpl;
import huzofw.repository.impl.MyBatisDaoUtils;
import cn.com.huzo.repository.master.StockReasonRepository;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;

/**
 * 入出库原因数据访问对象。
 *
 * @author 吴旭
 */
@Repository("StockReasonRepository")
public class StockReasonRepositoryImpl extends GenericRepositoryImpl<StockReasonEntity, Long>
        implements StockReasonRepository {

    private final String namespace = "cn.com.huzo.repository.master.StockReasonRepository";

    /**
     * 构造函数,设置the instance to StockReasonRepositoryImpl.class.
     */
    public StockReasonRepositoryImpl() {
        super(StockReasonEntity.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<StockReasonEntity> fetchAll(Integer inOutFlag) {
        Map<String, Object> params = new HashMap();
        params.put("InOutFlag", inOutFlag);

        return getSqlSession().selectList(MyBatisDaoUtils.getMapperQueryId(
                namespace, "fetchAll"), params);
    }
}
